import server from "../util/request.js";

export function findAllApi() {
    return server({
        url: "/unit/findAll",
        method: "GET"
    })
}
export function findByNameApi(name) {
    return server({
        url: `/unit/findByName/${name}`,
        method: "GET"
    })
}
export  function  addApi(data){
    return server({
        url:'/unit/add',
        method:'POST',
        data:data
    })
}
export function updateApi(data){
    return server({
        url:'/unit/update',
        method:'PUT',
        data:data
    })
}
export function deleteApi(unitId){
    return server({
        url:`/unit/delete/${unitId}`,
        method:'DELETE'
    })
}